Created
March 14, 2017 01:11
-
-
Save anonymous/8f1cc160356a75804924c7805fb9f95b to your computer and use it in GitHub Desktop.
dual linear actuators w/ wedge
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int kinematicsForward(const double *joints, | |
EmcPose * pos, | |
const KINEMATICS_FORWARD_FLAGS * fflags, | |
KINEMATICS_INVERSE_FLAGS * iflags) | |
{ | |
// 2x2 Matrix components | |
double a = tan(26 * M_PI/180); | |
double b = -1.0 * tan(26 * M_PI/180); | |
double c = 1.0; | |
double d = 1.0; | |
pos->tran.x = b * joints[0] + a * joints[2]; | |
pos->tran.z = joints[0]*2; | |
return 0; | |
} | |
int kinematicsInverse(const EmcPose * pos, | |
double *joints, | |
const KINEMATICS_INVERSE_FLAGS * iflags, | |
KINEMATICS_FORWARD_FLAGS * fflags) | |
{ | |
// 2x2 Matrix components | |
joints[2] = pos->tran.z/2 + pos->tran.x; | |
joints[0] = pos->tran.z/2; | |
return 0; | |
} | |
int kinematicsHome(EmcPose * world, | |
double *joint, | |
KINEMATICS_FORWARD_FLAGS * fflags, | |
KINEMATICS_INVERSE_FLAGS * iflags) | |
{ | |
*fflags = 0; | |
*iflags = 0; | |
return kinematicsForward(joint, world, fflags, iflags); | |
} | |
KINEMATICS_TYPE kinematicsType() | |
{ | |
return KINEMATICS_BOTH; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment